#ifndef SQL_API_H
#define SQL_API_H

#include "sql/sqlite3.h"

#include <algorithm>
#include <iostream>
using namespace std;


class ReadDictDatabase {
public:
	ReadDictDatabase(const string fcInSqlitePath);
	~ReadDictDatabase();
	string find_sqlite_dict(const string fcInTableName, const string fcInKeyWord);

private:
	sqlite3* mpSqlite;
};


class WriteDictDatabase{
public:
	WriteDictDatabase(const string fcInSqlitePath);
	~WriteDictDatabase();

	bool add_sqlite_dict(const string fcInTableName, const bool fcbInDeleteTable, const string fcInKey, const string fcInValue);

private:
	sqlite3 *mpSqlite;

	int create_dict_table(const string fcInTableName, const bool fcbInDeleteTable);

	vector<string> mvTableNames;

	const bool mcbDebug = false;
};

extern vector<string> gen_sqlite_dict(const string fcInSqlitePath, const string fcInTableName, const string fcInDictSrcPath, const bool fcbInDeleteTable);

#endif
